import sys
sys.path.append ('../')
sys.path.append ('../DataMiningPackage')
sys.path.append ('../data')
import ATrainModel as AM
import TTrainModel as TM
import data
from data import Data

OM = Data.ObjMemory()

ATM = AM.ATrainModel([0,1,2,5,6,7,8,9,10,11,12,13,14,15],0,'System',2,21,3)
OM.SaveObj (ATM,'./System/Action_EmotionModel.pkl')

ATM = AM.ATrainModel([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],1,'System',3,21,3)
OM.SaveObj (ATM,'./System/Hidden_ActivatingModel_A.pkl')

ATM = AM.ATrainModel([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],2,'System',3,21,3)
OM.SaveObj (ATM,'./System/Hidden_ActivatingModel_S.pkl')

ATM = AM.ATrainModel([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],3,'System',3,21,3)
OM.SaveObj (ATM,'./System/Hidden_ActivatingModel_F.pkl')


for i in range (1,4):
        if i == 1:
            char = 'A'
        elif i == 2:
            char = 'S'
        else:
            char = 'F'

        for j in range (0,10):
            path = './System/Activating_SolutionTrain_' + char + str(j+1) + '.pkl'

            ATM = AM.ATrainModel([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16+j],i,'System',16,21,3)
            OM.SaveObj (ATM,path)

TTM = TM.TTrainModel(0,'System')
OM.SaveObj (TTM,'./System/Text_HiddenModel.pkl')

OM = Data.ObjMemory()

ATM = AM.ATrainModel([0,1,2,5,6,7,8,9,10,11,12,13,14,15],0,'Local',2,21,3)
OM.SaveObj (ATM,'./Local/Action_EmotionModel.pkl')

ATM = AM.ATrainModel([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],1,'Local',3,21,3)
OM.SaveObj (ATM,'./Local/Hidden_ActivatingModel_A.pkl')

ATM = AM.ATrainModel([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],2,'Local',3,21,3)
OM.SaveObj (ATM,'./Local/Hidden_ActivatingModel_S.pkl')

ATM = AM.ATrainModel([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],3,'Local',3,21,3)
OM.SaveObj (ATM,'./Local/Hidden_ActivatingModel_F.pkl')


for i in range (1,4):
        if i == 1:
            char = 'A'
        elif i == 2:
            char = 'S'
        else:
            char = 'F'

        for j in range (0,10):
            path = './Local/Activating_SolutionTrain_' + char + str(j+1) + '.pkl'

            ATM = AM.ATrainModel([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16+j],i,'Local',16,21,3)
            OM.SaveObj (ATM,path)

TTM = TM.TTrainModel(0,'Local')
OM.SaveObj (TTM,'./Local/Text_HiddenModel.pkl')